<!--{template common/header_simple_start}-->
<link rel="stylesheet" href="static/css/checkbox.css" media="all">
<link href="static/css/common.css?{VERHASH}" rel="stylesheet" media="all">
<script type="text/javascript" src="{MOD_PATH}/scripts/main.js?{VERHASH}"></script>
<script type="text/javascript" src="static/js/jquery.leftDrager.js?{VERHASH}"></script>
<!--{template common/header_simple_end}-->
<script type="text/javascript">
var baseurl='{MOD_URL}';
var ajaxurl='{MOD_URL}&op=my';
var modpath='{MOD_PATH}';
</script>
<style type="text/css">
.jilu-my{
    margin-bottom: 30px;
}
.loader{
    background-color: #f2f2f2;
}
.tooltip-inner{
    min-width: 80px;
}
</style>
<!--{template common/commer_header}-->
<div class="bs-container clearfix">
	<div class="bs-left-container  clearfix">
		<!--{template left}-->
	</div>
	<div class="left-drager">
	</div>	
	<div class="bs-main-container">
    <div class="main-content container clearfix" style="padding:0"> 
      <!--{if $perm>0}-->	
      <div class="posts-date">
        <h4 class="posts-date-name">
           <a class="found" data-href="{MOD_URL}&op=ajax&do=create" onclick="showWindow('create',this.getAttribute('data-href'),'get',0);">
               <i class="dzz dzz-add-circle"></i>
               {eval echo lang('create_jiluben')}</a>
         </h4>
      </div>
     <!--{/if}-->
     <div class="itemContainer" style="position: relative;">
       <ul class="posts-group jilu-my" id="itemContainer" style="position: relative;">
          <!--{template my_item}-->
      </ul>
    </div>
    </div>
	</div>
</div>
<div class="popbox clearfix" style="display: none;">
	<div class="popbox-pointer">
    <div class="gb_I" style="display: block;"></div>
    <div class="gb_H" style="display: block;"></div>
  </div>
  <div class="popbox-container">
   <div class="loadding"></div>
  </div>
</div>
<script type="text/javascript">
jQuery('.left-drager').leftDrager_layout();
setSearchValue();
<!--{if $ismobile}-->
  var tap='touchend';
<!--{else}-->
  var tap='click';
<!--{/if}-->
jQuery(".bs-main-container").scroll(function(e) {//滚动加载
    var main_container = jQuery(".bs-main-container").height();
    var container_h = jQuery(".container").height();
    var scroll_top = jQuery(".bs-main-container").scrollTop();
    if(scroll_top+main_container>=container_h-20){
         jQuery('#loadmore').trigger(tap);
    }
});
gridview9_init(jQuery('.gridview9'));

jQuery(document).ready(function(e) {
    jQuery("[data-toggle='tooltip']").tooltip();
    jQuery(document).on('mouseenter','.onready_top',function () {
        jQuery(this).text('{lang cancel_top}')
    })
    jQuery(document).on('mouseout','.onready_top',function () {
        jQuery(this).text('{lang toped}')
    })

    jQuery(document).on('mouseenter','.item',function(){
		jQuery(this).addClass('hover');
	});
	 jQuery(document).on('mouseleave','.item',function(){
		jQuery(this).removeClass('hover');
	});
	<!--{if $ismobile}-->
	 jQuery(document).on('click','.post,.post .url',function(){
		//jQuery(this).find('.url').trigger('click');
		window.open(jQuery(this).closest('.post').data('url'));
		return false;
	});
	<!--{/if}-->
	jQuery('.js-popbox').each(function(){
		jQuery(this).popbox();
	});
function top_move(jid){
    var obj = jQuery("#jilu_"+jid);
    var prevall = obj.prevAll().not(".admin-top");
    if(obj.prev().length > 0){
        prevall.stop().animate({top:119}, 200);
        obj.animate({top:-119*prevall.length}, 300, function(){
            prevall.eq(prevall.length - 1).before(obj);
            jQuery("#itemContainer").children("li").hide().css("top", 0).show();
        });
    }
}
//置顶
    jQuery(document).on('click', '.click_top', function () {
      var click_d = jQuery(this);
      var jid=click_d.parent().parent().attr('jid');
      jQuery.ajax({
        url:'{MOD_URL}&op=ajax&do=jilu_pin&id='+jid+'&display=1',
        dataType:'json',
        type:'post',
        delay:'1500',
        success:function(data) {
          if(data.msg == 'success'){
              top_move(jid);
              showmessage('{eval echo lang("top_success")}','success',3000,1);
              click_d.removeClass('click_top').addClass('onready_top').html('{eval echo lang("toped")}');
          } else {
              showmessage(data.msg,'danger',3000,1);
          }

        },
        error:function () {
            showmessage('{eval echo lang("top_failed")}','danger',3000,1);
        }
      })
    })
//取消置顶
    jQuery(document).on('click','.onready_top',function () {
      var click_d = jQuery(this);
      var jid=click_d.parents('.post2').attr('jid');
      jQuery.ajax({
        url:'{MOD_URL}&op=ajax&do=jilu_pin&id='+jid+'&display=0',
        dataType:'json',
        type:'post',
        delay:'1500',
        success:function(data) {
        if(data.msg == 'success'){
            var i = 0;
            jQuery("#itemContainer").children("li").each(function(){
                var t = jQuery(this);
                if(t.children(".time-btn").children(".onready_top").length > 0 || t.hasClass("admin-top") || t.attr('id') == "jilu_"+jid){
                    i++;
                    return true;
                }
                if(t.attr('data-time') <= jQuery("#jilu_"+jid).attr('data-time')){
                    return false;
                }
                i++;
            });
            i = i > 0 ? i-1 : 0;
            if(i > 0){
                var moveItem = jQuery("#itemContainer").children("li:lt("+(i+1)+")").not("#jilu_"+jid).not(jQuery("#jilu_"+jid).prevAll());
                moveItem.animate({top:-119}, 200);
                jQuery("#jilu_"+jid).animate({top:119*moveItem.length}, 300, function(){
                    jQuery("#itemContainer").children("li").hide().css("top", 0).show();
                    jQuery("#itemContainer").children("li:eq("+i+")").after(jQuery("#jilu_"+jid));
                });
            }
            showmessage('{eval echo lang("cancel_top_success")}','success',3000,1);
            click_d.removeClass('onready_top').addClass('click_top').html('{eval echo lang("top")}');

        } else {
            showmessage(data.msg,'success',3000,1);
        }

        },
        error:function () {
            showmessage('{eval echo lang("cancel_top_failed")}','danger',3000,1);
        }
      })
    })
});
function toggle_group(obj){
	var el=jQuery(obj);
	var tel=el.parent().parent().next('.posts-group');
	if(el.find('i').hasClass('glyphicon-menu-down')){
		el.find('i').removeClass('glyphicon-menu-down').addClass('glyphicon-menu-right');
	}else{
		el.find('i').removeClass('glyphicon-menu-right').addClass('glyphicon-menu-down');
	}
	tel.slideToggle();
}
</script> 
<script src="static/bootstrap/js/bootstrap.min.js?{VERHASH}"></script>
<!--{template common/footer_simple}-->